
<?php 
include '../includes/common.php';

// 获取请求方的 IP 地址
function getClientIP() {
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}

// 获取 GET 参数
$jsonData =input('input')?:input();

// var_dump();exit;
// 解码 JSON 数据
$decodedData = $jsonData;

// 如果解码失败，$decodedData 将为 null
if ($decodedData === null && json_last_error() !== JSON_ERROR_NONE) {
    $decodedData = ['error' => 'Invalid JSON data'];
}

// 获取客户端 IP
$clientIP = getClientIP();

// 构建要写入文件的数据
$logData = [
    'timestamp' => date('Y-m-d H:i:s'),
    'ip' => $clientIP,
    'data' => $decodedData
];

// 将数据写入文件
file_put_contents(PUBLICROOT."apidemo.json", json_encode($logData, JSON_PRETTY_PRINT) . ",", FILE_APPEND);

echo 'success';exit;
exit;
use lib\email_template;
$data=[
    'user'=>'admin123',
    'paragraphs' => [
        ['label' => 'PID', 'value' => 123456],
        ['label' => '订单号', 'value' => 456789],
        ['label' => '收款方式','value'=>'支付宝'],
        ['label' => '商品名称','value'=>'测试'],
        ['label' => '站点地址','value'=>$httphost],
        ['label' => '有问题请联系站长QQ','value'=>$conf['qq']]
        ]
    ];

$temp = order_emailtemp;
var_dump(email_template::$temp($data,'新订单通知'));
exit;
var_dump(base64_decode('ZFdsdVBXOHlOamt5TWpNeE5qazBPeUJ6YTJWNVBVMWpPSE5XWkVRMlEyVTdJSEIwTW1kbmRXbHVQVzh5TmpreU1qTXhOamswT3lCd1gzVnBiajF2TWpZNU1qSXpNVFk1TkRzZ2NIUTBYM1J2YTJWdVBURnZXRmwxV1ZkeFJrdHFLakV4U1c0MFNFbEliM2MyT1VGUVRHRnJSa2t0VFcxc1kxcEpOVWhFZWxsZk95QndYM05yWlhrOVNFWk5UREJEV1ZsWk1taFhWMVJoVWs1eVVYRnBUR0prTmtsbU1HWnhNblY2V1dKNGNGZHpObEpQYzE4N2NXeDFhVzQ5TWpZNU1qSXpNVFk1TkE9PQ=='));

exit;


?>
<img src="">
<?php exit;
require_once './Core/Config.php';

$dsn = 'mysql:host='.$dbconfig['host'].';port='.$dbconfig['port'].';dbname='.$dbconfig['dbname'].';charset=utf8';
try {
	$DB=new PDO($dsn,$dbconfig['user'],$dbconfig['pwd']);
} catch(Exception $e) {
    Tips::error('数据库连接错误，请检查 Config.php 文件' );
}

$id = $_GET['id'];
$sql = "SELECT * FROM pay_qrlist WHERE id='{$id}' limit 1";
echo "sql语句" . $sql ;
echo "<br>";
echo "<br>";
$row = $DB->query($sql)->fetch();
if($row)
	{
  	echo 'You are in...........';
  	echo "<br>";
    	echo "</font>";
  	}
	else 
	{
	}


var_dump($row);
exit;
$priKey = 'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDFKaddMnBv3LAh
dCg+ZtuM/yv9EZyN8LfkvzO91oEJbc65CqHtPYvIKFCdMHKu1Iv+W67+5DT/GWGq
JvewTQyj/8AG1WgATVU6OEGk4Zre1QMJLbgNlMeNWjz8PC+cpgxwwk8nmIiDs2kR
npkHAdQ8yoDr4h/SOips8cftopt9dgfyGkhj1b9Gx98P9qZTDJ+l2T/hIFkGGs6O
LC7Nh4RAsmJ4DxjDoQMcple7sSbqRCGKnw3HYI+zRJx8vfkhcmMFH88aYI3xTSrS
gCJgrT+mqKtma8xpFFPRsLxzEx4USquz+itOOlruMKmf0pKenbWZO/ZL5QVRzxLM
0dEye0c5AgMBAAECggEAUYsNtkTjLdCnY96nuk9OJH1w0wTSq/3QAKJ3ot8xlRW+
NtfH6tfWlRzfYnOkKtyrXbLLqI33wT3dH8NoE5l6TeW7pNfkYKObSS31MF1CcUDG
NaicA7nx4mtc57F4u6ANayFiHW0/oMC2BtyCS9ycy9uxAF4QbSEzZMWGu6jSCEvr
GsnpkAlwWNj7Ib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EY-----\n" .
        wordwrap($priKey, 64, "\n", true) .
        "\n-----END RSA PRIVATE KEY-----";





$token = 'dU1JZkZob1FVb0I5S3lCZit4M1RWZkQ2d21OYnZUQXZ1dW14T2ZnTSs1OHlzUFNaQzhZam01NFVpRzdHdURiNTd5bTgzcDZ1SUpObXVNeC9CV1YwRlJkM3dCTWo0UzV5ZTE1NndLdUhMK3Z2bmZlUS9GWFZPSW5ieDh4aWdxSk51c2dBalh4TlRzL1FTU2tRVDNWTDZDVEo0R2dPVlN0dGFpQ1RTYzhXYklOYjdPVDZYdGNEWDRQN1FLcnBhWG9VUFFuaXBGaWRKZGpwZE9IUEdKeDBxbHZPUFIyQXc1Qmloa3V2R1ZqMHJCQWZteWtaTktHMW4yR3BaRkxwbzIxTEJLUW1sVzRrVTNzcTVzeHp1WisxUUlhdFVYdUR5V0J4Wm9LbmdGWFVhM0FxREZYZnV1LzhJQ2RZRWpSZGwxRnNvQ21NM2pLU1ZnU3hibjFyYmRoYWVQOUdJMnFjSjlKbS83azhGRU81VU1FWERDNE5WQW4ra3JFeUxjSVJyNURiZ2w1OWZ2UVZlaERCWXdyQjNHWnhJMUs2NSttVk1hMnAzWG14emJNQjd5b3JVc244a003b1hCKzBERU43bXBpeHl4L3hHZEphZmFGcUdiYnIwZEFwbXpqOWllNHN5dnBiNTcyOWVId1RHdmM9';
var_dump($token);
echo '<br>';
var_dump(base64_decode($token));
echo '<br>';
$data = base64_decode(base64_decode($token));
var_dump($data);
echo '<br>';
$iv = substr($data, 0, 16);
var_dump($iv);
echo '<br>';
 $encrypted = substr($data, 16);
 var_dump($encrypted);
 
 echo '<br>';
 $decrypted = openssl_decrypt($encrypted, 'aes-256-cbc', md5('xfappgua1745387748####****'), OPENSSL_RAW_DATA, $iv);
 
 var_dump($decrypted);
 
 echo '<br>';
 
 var_dump(base64_decode($decrypted));
 echo '<br>';
 
 
 openssl_private_decrypt(base64_decode($decrypted), $decrypted, $res);
 
 var_dump($decrypted);
 echo '<br>';
 $aeskey   = substr($decrypted, 0, 32);
$aesdata  = substr($decrypted,32);

var_dump($aeskey);
echo '<br>';
var_dump($aesdata);
echo '<br>';

exit;
include './Core/Common.php';
 $sql = "SELECT * FROM pay_qrlist WHERE id='393' limit 1";
$QR_row = executeSQLQuery($sql);
var_dump(check_usdt($QR_row));
exit;
var_dump(base64_decode('KOzXK3W3csFPqoxp7UtC3Q=='));
exit;
// var_dump(usdt("usdtpay","1"));
// exit;

$mac = Machine_effectproduce();
var_dump($mac);
echo '<br>';
$token = mactoken($mac,'1234567..');
var_dump($token);
echo '<br>';
var_dump(Machine_effect($token,'1234567..'));

?>